// pages/lostDetail/index.js

import { request } from "../../request/index.js";
import regeneratorRuntime from "../../lib/runtime/runtime";

Page({
  /**
   * 页面的初始数据
   */
  data: {
    tabs: [{ id: 0, value: "钥匙招领", isActive: true }],
    lostList: [],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let { id } = options;
    this.lostList(id);
  },

  //获取所有失物招领
  async lostList(params) {
    const res = await request({ url: "/lastfound/findAllLastFound" });
    let lostList = res.data.data.filter((v) => v.id == params);
    this.setData({
      lostList,
    });
  },
});
